package com.codeZ.VisitiorPattern;


/**
 * @author codeZhang
 * @Date 2024/8/29 17:09
 */
public class Client {
    public static void main(String[] args) {
        ObjectStructure structure = new ObjectStructure();
        for (int i = 0; i < 10; i++) {
            if(i % 2 == 0){
                structure.attach(new ConcreteElementA());
            }else{
                structure.attach(new ConcreteElementB());
            }
        }
        structure.accept(new ConcreteVisitor());
    }
}
